<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo C('site_name');?></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" href="<?php echo STATICS;?>/css/bootstrap.min.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?php echo STATICS;?>/css/jquery-ui.min.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?php echo STATICS;?>/css/font-awesome.min.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?php echo RES;?>/css/admin.css" type="text/css"/>
</head>
<script type="text/javascript" src="<?php echo STATICS;?>/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<?php echo STATICS;?>/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?php echo STATICS;?>/js/jquery.artDialog.js?skin=aero"></script>
<script type="text/javascript" src="<?php echo STATICS;?>/js/iframeTools.js"></script>
<script type="text/javascript" src="<?php echo STATICS;?>/js/jquery.form.min.js"></script>
<script type="text/javascript" src="<?php echo STATICS;?>/js/jquery.validate.min.js"></script>
<script language="javascript" src="<?php echo STATICS;?>/js/jquery.imagePreview.js"></script>
<script type="text/javascript" src="<?php echo STATICS;?>/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php echo STATICS;?>/js/datepicker.js"></script>
<script type="text/javascript" src="<?php echo RES;?>/js/common.js"></script>
<body>
<!--顶部-->
<nav class="navbar navbar-inverse">
	<div class="container-fluid">
		<div class="navbar-header">      
      	<a class="navbar-brand" href="<?php echo U('Index/index');?>"><?php echo C('site_name');?>后台管理</a>
    	</div>

    	<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">    
      		<ul class="nav navbar-nav navbar-right">
        		<li><a href="<?php echo C('site_url');?>" target="_blank"><i class="glyphicon glyphicon-home"></i> 网站首页</a></li> 
                <li class="dropdown">
          			<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="glyphicon glyphicon-user"></i> <?php echo ($adminGroup); ?>【<?php echo ($adminName); ?>】 <span class="caret"></span></a>
          			<ul class="dropdown-menu" role="menu">
            			<li><a href="<?php echo U('User/password');?>">修改密码</a></li>
            			<li><a href="<?php echo U('Login/exitSystem');?>">退出</a></li>
          			</ul>
        		</li>         
      		</ul>
    	</div><!-- /.navbar-collapse -->
  	</div><!-- /.container-fluid -->
</nav>
<!--顶部结束-->

<div class="container-fluid">
	<div class="row">
		<div class="col-md-2">
			<div id="nav">
				<p id="p_home"><i class="glyphicon glyphicon-home"></i> 首页</p>
				<div class="menu_body" id="b_home">
				<li><i class="glyphicon glyphicon-menu-right"></i> <a href="<?php echo U('Index/index');?>">系统信息</a></li>
				</div>

				<p id="p_one"><i class="glyphicon glyphicon-file"></i> 单页面管理</p>
				<div class="menu_body" id="b_one">
				<li><a href="<?php echo U('One/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 单页面列表</a></li>
	            <li><a href="<?php echo U('One/add');?>"><i class="glyphicon glyphicon-menu-right"></i> 添加单页面</a></li>
				</div>

				<p id="p_article"><i class="glyphicon glyphicon-list-alt"></i> 文章管理</p>
				<div class="menu_body" id="b_article">			
	            <li><a href="<?php echo U('Article/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 文章列表</a></li>
	            <li><a href="<?php echo U('Article/add');?>"><i class="glyphicon glyphicon-menu-right"></i> 添加文章</a></li>
	            <li><a href="<?php echo U('Category/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 文章分类</a></li>
				</div>				

				<p id="p_user"><i class="glyphicon glyphicon-user"></i> 会员管理</p>
				<div class="menu_body" id="b_user">			
	            <li><a href="<?php echo U('Member/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 会员列表</a></li>				
	            <li><a href="<?php echo U('Member/index',array('userType'=>1));?>"><i class="glyphicon glyphicon-menu-right"></i> 业务员</a></li>
	            <li><a href="<?php echo U('Member/index',array('userType'=>2));?>"><i class="glyphicon glyphicon-menu-right"></i> 商家</a></li>	
				</div>

				<p id="p_activity"><i class="glyphicon glyphicon-gift"></i> 抽奖活动</p>
				<div class="menu_body" id="b_activity">			
	            <li><a href="<?php echo U('Activity/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 获奖名单</a></li>				
	            <li><a href="<?php echo U('Activity/setting');?>"><i class="glyphicon glyphicon-menu-right"></i> 活动设置</a></li>
				</div>

				<p id="p_goods"><i class="glyphicon glyphicon-shopping-cart"></i> 商城管理</p>
				<div class="menu_body" id="b_goods">			
	            <li><a href="<?php echo U('Goods/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 商品列表</a></li>
				<li><a href="<?php echo U('Goods/add');?>"><i class="glyphicon glyphicon-menu-right"></i> 添加商品</a></li>
				<li><a href="<?php echo U('ShopCate/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 商品分类</a></li>
				<li><a href="<?php echo U('Dispatch/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 配送设置</a></li>
				<li><a href="<?php echo U('Sms/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 短信设置</a></li>					
				<li><a href="<?php echo U('Pay/weixin');?>"><i class="glyphicon glyphicon-menu-right"></i> 支付设置</a></li>	
				</div>

				<p id="p_yongjin"><i class="glyphicon glyphicon-yen"></i> 佣金管理</p>
				<div class="menu_body" id="b_yongjin">			
	            <li><a href="<?php echo U('Yongjin/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 佣金列表</a></li>
	            <li><a href="<?php echo U('Tixian/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 提现申请</a></li>
	            <li><a href="<?php echo U('Yongjin/setting');?>"><i class="glyphicon glyphicon-menu-right"></i> 佣金设置</a></li>
				</div>

				<p id="p_order"><i class="glyphicon glyphicon-list-alt"></i> 订单管理</p>
				<div class="menu_body" id="b_order">			
	            <li><a href="<?php echo U('Order/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 订单列表</a></li>
	            <li><a href="<?php echo U('Order/detail');?>"><i class="glyphicon glyphicon-menu-right"></i> 订单明细</a></li>
	            <li><a href="<?php echo U('Order/index',array('payStatus'=>1));?>"><i class="glyphicon glyphicon-menu-right"></i> 已支付订单</a></li>
	            <li><a href="<?php echo U('Order/index',array('payStatus'=>0));?>"><i class="glyphicon glyphicon-menu-right"></i> 未支付订单</a></li>
				</div>

				<p id="p_baoxian"><i class="glyphicon glyphicon-inbox"></i> 交强险信息</p>
				<div class="menu_body" id="b_baoxian">			
	            <li><a href="<?php echo U('Baoxian/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 信息列表</a></li>
	            <li><a href="<?php echo U('Baoxian/index',array('status'=>0));?>"><i class="glyphicon glyphicon-menu-right"></i> 处理中</a></li>
	            <li><a href="<?php echo U('Baoxian/index',array('status'=>1));?>"><i class="glyphicon glyphicon-menu-right"></i> 已完成</a></li>
				</div>

				<p id="p_weixin"><i class="fa fa-wechat"></i> 微信设置</p>
				<div class="menu_body" id="b_weixin">			
	            <li><a href="<?php echo U('Weixin/menu');?>"><i class="glyphicon glyphicon-menu-right"></i> 自定义菜单</a></li>
	            <li><a href="<?php echo U('Reply/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 关键词回复</a></li>
	            <li><a href="<?php echo U('Weixin/setting');?>"><i class="glyphicon glyphicon-menu-right"></i> 接口设置</a></li>
				</div>

				<p id="p_feedbook"><i class="glyphicon glyphicon-pencil"></i> 在线咨询</p>
				<div class="menu_body" id="b_feedbook">
	            <li><a href="<?php echo U('Feedbook/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 咨询列表</a></li>
				</div>

				<p id="p_ad"><i class="glyphicon glyphicon-blackboard"></i> 运营管理</p>
				<div class="menu_body" id="b_ad">	            
	            <li><a href="<?php echo U('Ad/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 广告列表</a></li>
	            <li><a href="<?php echo U('Ad/add');?>"><i class="glyphicon glyphicon-menu-right"></i> 添加广告</a></li>
	            <li><a href="<?php echo U('Adtype/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 广告位分类</a></li>
	            <li><a href="<?php echo U('Link/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 友情链接</a></li>
	            <li><a href="<?php echo U('Link/add');?>"><i class="glyphicon glyphicon-menu-right"></i> 添加友情链接</a></li>
				</div>			

				<p id="p_db"><i class="glyphicon glyphicon-floppy-disk"></i> 数据备份还原</p>
				<div class="menu_body" id="b_db">
				<li><a href="<?php echo U('Db/index');?>"><i class="glyphicon glyphicon-menu-right"></i> 备份与还原</a></li>
				</div>

				<p id="p_sys"><i class="glyphicon glyphicon-cog"></i> 系统设置</p>
				<div class="menu_body" id="b_sys">
				<li><a href="<?php echo U('Site/info');?>">站点设置</a></li>	
				<li><a href="<?php echo U('Site/upfile');?>">上传设置</a></li>	
				
				
								
				<li><a href="<?php echo U('User/index');?>">管理员设置</a></li>			
				<li><a href="<?php echo U('Group/index');?>">用户组管理</a></li>
				<li><a href="<?php echo U('Node/index');?>">节点管理</a></li>
				</div>
			</div>
		</div>

		<div class="col-md-10">
			
	<ol class="breadcrumb">
		<li><a href="<?php echo U('Goods/index');?>">商品管理</a></li>
      	<li class="active">列表</li>
    </ol>

    <script type="text/javascript">
	$(document).ready (function(){
		$(".preview").preview();
	});

	function jumpUrl(){
	  v = document.getElementById("path").options[document.getElementById("path").selectedIndex].value;
	  url="<?php echo U('Goods/index');?>&path=" + v;
	  window.location.href=url;
	}
	</script>

	<form class="form-inline" method="get" action="index.php">
  		<div class="form-group">
  			<label>分类</label>
    		<select name="path" id="path" onchange="jumpUrl()" class="form-control input-sm">
				<option value="">全部</option>
				<?php if(is_array($sclass)): $i = 0; $__LIST__ = $sclass;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value='<?php echo ($vo['path']); ?>'><?php for($i=0; $i<$vo['count']*2; $i++){ echo '&nbsp;&nbsp;'; } echo ($vo['name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
			</select>
    		<label>关键词</label>
    		<input type="text" class="form-control input-sm" name="keyword" value="<?php echo ($keyword); ?>">
  		</div>
		<button type="submit" class="btn btn-default btn-sm">搜索</button>
		<input type="hidden" name="g" value="Admin" />
		<input type="hidden" name="m" value="Goods" />
		<input type="hidden" name="a" value="index" />
	</form>

	<p></p>

	<form id="ajaxForm" method="post" action="<?php echo U('Goods/del');?>" name="form1" class="form-horizontal form-validata">
	<TABLE class="table table-striped table-bordered table-hover">
	  <THEAD>
		<tr>
		  <TH><input class="checkall" name="checkall" type="checkbox" id="checkall" onClick="CheckAll(this.form)"/> 全选</TH>
		  <TH>名称</TH>
		  <TH>分类</TH>
		  <TH>图片</TH>		   
		  <TH>销售价</TH>
		  <TH>属性</TH> 
		  <TH>状态</TH>		  
		  <TH>规格</TH>		  
		  <TH>排序</TH>		  		  
		  <TH>添加日期</TH>
		  <TH>更新日期</TH>
		  <TH>操作</TH>
		</tr>
	  </THEAD>
	  <TBODY>             
			<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
			  <td><input type="checkbox" name="selectedids[]" value="<?php echo ($vo["id"]); ?>" id="<?php echo ($vo["id"]); ?>"> <?php echo ($vo["id"]); ?></td>
			  <td><a href="<?php echo U('Goods/edit' , array('id'=>$vo['id']));?>"><?php echo ($vo["name"]); ?></a></td>
			  <td><?php echo ($cate[$vo['cid']]); ?></td>
			  <td><img src="<?php echo ($vo["picname"]); ?>" style="height:40px" class="preview" alt="<?php echo ($vo["picname"]); ?>" title="<?php echo ($vo["name"]); ?>"></td>		
			  <td>￥<?php echo ($vo["price"]); ?></td>	 
			  <td>
			  	<?php if(($vo["index"]) == "1"): ?><font color="red">首页</font><?php endif; ?>
			  	<?php if(($vo["tejia"]) == "1"): ?><font color="blue">特价</font><?php endif; ?>
			  	<?php if(($vo["baoxian"]) == "1"): ?><font color="green">交强险</font><?php endif; ?>
			  </td>	 
			  <td><?php if(($vo["show"]) == "1"): ?>销售中<?php else: ?><font color="red">下架</font><?php endif; ?></td>	  
			  <td><?php if(($vo["hasoption"]) == "1"): ?><font color="green">启用</font><?php else: ?>关闭<?php endif; ?></td>	  
			  <td><?php echo ($vo["sort"]); ?></td>	  
              <td><?php echo (date('Y-m-d H:i:s',$vo["createTime"])); ?></td>
              <td><?php echo (date('Y-m-d H:i:s',$vo["updateTime"])); ?></td>
			  <td>
			  <a href="<?php echo U('Goods/edit' , array('id'=>$vo['id']));?>" class="btn btn-default btn-sm"><i class="glyphicon glyphicon-edit"></i> 编辑</a>
			  <a href="<?php echo U('Goods/pram' , array('goodsID'=>$vo['id']));?>" class="btn btn-default btn-sm"><i class="glyphicon glyphicon-cog"></i> 规格</a>
			  <a href="<?php echo U('Goods/image' , array('goodsID'=>$vo['id']));?>" class="btn btn-default btn-sm"><i class="glyphicon glyphicon-picture"></i> 商品图片 <?php echo ($vo["album"]); ?> 张</a>
			  <a href="javascript:void(0)" onclick="_alert('<?php echo C('site_url');?>/index.php/wap/store/view/id/<?php echo ($vo["id"]); ?>.html')" class="btn btn-default btn-sm">链接</a>
			  </td>
			</tr><?php endforeach; endif; else: echo "" ;endif; ?>
	  </TBODY>
	</TABLE>

	<div class="row">
		<div class="col-md-6">
			<button class="btn btn-info btn-sm" onClick="if(!confirm('删除后不可恢复！确定吗？'))return false;"><i class="glyphicon glyphicon-trash"></i> 删除选中信息</button>
		</div>
		
		<div class="col-md-6">
			<div class="page">
				<nav>
  					<ul class="pagination"><?php echo ($page); ?></ul>
  				</nav>
  			</div>
		</div>
	</div>
	</form>

<script type="text/javascript">
$("#path").val("<?php echo ($path); ?>");

function _alert(url){
	art.dialog({
		title : '消息提示',
	  content : url,
	     lock : true
	})
}
</script>

<input type="hidden" id="menu_action" value="goods" />
		</div>
	</div>

</div>

<script type="text/javascript">
$(document).ready(function(){
  //幻灯片元素与类“menu_body”段与类“menu_head”时点击
  var menu_action=$("#menu_action").val();
  $("#p_"+menu_action).addClass("select");
  $("#b_"+menu_action).show().addClass("local");  


  $("#nav p").click(function(){
	$(this).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
	$("#nav p").removeClass("select");
	$(this).addClass("select");
	$(this).next("div.menu_body").addClass("local");
  });
});
</script>

</body>
</html>